package com.usian.user.controller;

import com.usian.model.common.dtos.ResponseResult;
import com.usian.model.user.dtos.LoginDto;
import com.usian.model.user.pojos.ApUser;
import com.usian.user.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("api/v1/user")
public class AccountController {
    @Autowired
    private AccountService service;
    @PostMapping("login/c")
    public ResponseResult login(@RequestBody LoginDto dto){
        return service.login(dto);
    }

    @GetMapping("getUserById/{userId}")
    public ApUser getUserById(@PathVariable Integer userId){
        return service.getById(userId);
    }
}
